﻿using Microsoft.VisualStudio.TestTools.UITesting;

namespace TestExtensions
{
    public static class UISearchExtensions
    {
        public static UISearch.IWhereProvider Where(this UITestControl @this, string propertyName)
        {
            return new UISearch(@this).Where(propertyName);
        }

        public static TControl Find<TControl>(this UITestControl @this)
            where TControl : UITestControl
        {
            return new UISearch(@this).Find<TControl>();
        }

        public static UISearch.IWhereProvider Where(this BrowserBase @this, string propertyName)
        {
            return new UISearch(@this._browser).Where(propertyName);
        }

        public static TControl Find<TControl>(this BrowserBase @this)
            where TControl : UITestControl
        {
            return new UISearch(@this._browser).Find<TControl>();
        }
    }
}